﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Project
{
    public partial class Form2 : Form
    {
        public Form2()
        {
            InitializeComponent();
        }
       

        private void button2_Click(object sender, EventArgs e)
        {
            MessageBox.Show("已经取消注册！！！" );
        }
      
       private   void btnRsgister_Click(object sender, EventArgs e)
        {
            var uid = userName.Text;
            var pwd = passPwd.Text;
            var rpwd = reTypassWord.Text;
            var isUidNull = string.IsNullOrEmpty(uid);
            var isPwdNull = string.IsNullOrEmpty(pwd);
            var isEquer = pwd == rpwd;
            
            if (!isUidNull && !isPwdNull && isEquer )
            {
                MessageBox.Show("注册成功", "恭喜你", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
                Form1._user.Add(uid ,pwd);
                 
            }
            else
            {
                MessageBox.Show("注册未成功", "很遗憾", MessageBoxButtons.YesNo, MessageBoxIcon.Error );

            }
        }

             public  void Form2_Load(object sender, EventArgs e)
        {
           

        }
    }
}
